#ifndef KINECTSTREAMRECORDERDIALOG_H
#define KINECTSTREAMRECORDERDIALOG_H

#ifdef KINECT

#include <QDialog>
#include <QTime>
#include <QImage>

#include "GUI/kinect/kinectdialog.h"
#include "Core/Animation/robotaction.h"

namespace Ui {
    class KinectStreamRecorderDialog;
}

/**
  * @brief Captures a constant stream of positions to create an exact recording of a user skeleton from the Kinect.
  */
class KinectStreamRecorderDialog : public KinectDialog {
private:
    Q_OBJECT
    Ui::KinectStreamRecorderDialog *ui;

    RobotAction* _currentAction;
    RobotAction* _returnAction;

    QTime _startTime;

public:
    explicit KinectStreamRecorderDialog(kinect::Kinect* kinect, QWidget *parent = 0);
    ~KinectStreamRecorderDialog();

#ifdef WIIMOTE
    // Enable input from the wiimote
    void associateWiimote(WiimoteStatusDialog *dialog);
#endif

    /**
      * @brief Gets the captured action. Returns NULL if no action was captured. Ownership of the action
      * is transferred to the caller.
      */
    RobotAction* getRecordedAction();

public slots:
    // Recording state manipulation
    void start();
    void stop();
    void toggle();

private slots:
    void updateImage(QImage* image);

protected:
    //void kinectKeyFrame(MotionKeyFrame keyFrame);
    void receiveTroyPose(QSharedPointer<TroyPose> pose);

};

#endif

#endif // KINECTSTREAMRECORDERDIALOG_H
